
const router = require('koa-router')()

router.prefix('/newscommentimg')

//projectwork
//根据collect_id=>newsid获取newscommentimg详情
router.get('/single', async (ctx, next) => {
    let newscom_id = ctx.request.body.newscom_id;
    let result = await ctx.db.EXCUTE('SELECT * FROM commentsimg WHERE newscom_id=' + newscom_id);
    console.log(result);
    if(result[0]){
        ctx.body = {
            code:200,
            data:result,
            msg:'newscommentimg'
          }
    }else{
        ctx.body = {
            code:200,
            data:result,
            msg:'null'
          }
    }
})

module.exports = router